package com.hetao.xx.activity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import com.alibaba.fastjson.JSON;
import com.hetao.xx.Global;
import com.hetao.xx.R;
import com.hetao.xx.game.model.User;
import com.hetao.xx.game.model.UserArms;
import com.hetao.xx.orm.UserVo;
import com.hetao.xx.service.IntentManager;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class StartActivity extends AppCompatActivity {

    private final String Tag = getClass().getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start_page);
        ButterKnife.bind(this);
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        toolbar.setTitle("江湖");

    }

    @SuppressLint("NonConstantResourceId")
    @OnClick({R.id.start_new, R.id.start_load, R.id.start_del, R.id.start_abort, R.id.start_custom})
    public void onClick(View v) {

        switch (v.getId()) {
            case R.id.start_new:
                IntentManager.toNew(this);
                break;
            case R.id.start_load:
                IntentManager.toLoad(this);
                break;
            case R.id.start_del:
                IntentManager.toDel(this);
                break;
            case R.id.start_abort:
                IntentManager.toAbort(this);
                break;
            case R.id.start_custom:
                IntentManager.toCustom(this);
                break;
        }

    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == IntentManager.StartRequestCode && resultCode == IntentManager.StartClose) {
            finish();
        }
    }
}
